﻿using BaoVeBienCuong.SelectMap;
using Microsoft.Phone.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
//using WapChargingSDK;

namespace NapThe
{
   public  class NapXu
    {
        public NapTheDienThoai naptheDienThoai { get; set; }
        public Khac khacScreen { get; set; }
        public NapTheQplay naptheQplay { get; set; }
        public static Report report { get; set; }
        public KhongDuXu khongDuXu { get; set; }
        public GamePageNapThe gamepage { get; set; }
        Grid MainLayoutRoot;
        public NapXu(Grid MainLayoutRoot)
        {
            this.MainLayoutRoot = MainLayoutRoot;
            gamepage = new GamePageNapThe(MainLayoutRoot, this);
            naptheDienThoai = new NapTheDienThoai(MainLayoutRoot,this);
            khacScreen = new Khac(MainLayoutRoot,this);
            naptheQplay = new NapTheQplay(MainLayoutRoot,this);
            report = new Report(MainLayoutRoot,this);
            khongDuXu = new KhongDuXu(MainLayoutRoot, this);
            
        }
        public void NapXuSms()
        {
            MessageBoxResult m =
                          MessageBox.Show("Bạn có muốn nạp thẻ với giá ưu đãi 15.000 đồng được 30.000 xu không ?", "Nạp tiền", MessageBoxButton.OKCancel);
            if (m == MessageBoxResult.OK)
            {
                SmsComposeTask smsComposeTask = new SmsComposeTask();
                smsComposeTask.To = SMSModel.address;
                smsComposeTask.Body = SMSModel.content;
                smsComposeTask.Show(); // this will invoke the native sms edtior

            }
            else if (m == MessageBoxResult.Cancel)
            {

                naptheDienThoai.OnVisible();
            }
        }
        public void OnNapTheDienThoaiVisible()
        {
            naptheDienThoai.radioButton3.IsChecked = true;
            naptheDienThoai.Visibility = Visibility.Visible;
        }
        public bool isVisible()
        {
            if (naptheDienThoai.Visibility == Visibility.Visible || khacScreen.Visibility == Visibility.Visible
                || naptheQplay.Visibility == Visibility.Visible || khongDuXu.Visibility == Visibility.Visible)
            {
                return true;
            }
            return false;
        }
        public void Collapsed()
        {
            naptheDienThoai.Visibility = Visibility.Collapsed ;
            khacScreen.Visibility = Visibility.Collapsed;
             naptheQplay.Visibility = Visibility.Collapsed;
             khongDuXu.Visibility = Visibility.Collapsed;
             report.Visibility = Visibility.Collapsed;
        }
        public void SubMoney(int money)
        {
            NapTheDienThoaiController n = new NapTheDienThoaiController();
            n.isEnoughMoney(true, money);
        }
        public void DisplayXu()
        {
            NapTheDienThoaiController n = new NapTheDienThoaiController();
            n.process(gamepage);
        }
        public bool CheckMoney(int checkMoney)
        {
            NapTheDienThoaiController p = new NapTheDienThoaiController();
            if (p.CheckMoney(checkMoney))
            {
                SelectMapAndStore.isClickVang = true;
                khongDuXu.Visibility = Visibility.Visible;
                return true;
            }
            return false;
        }
    }
}
